package StudyCode.summary.Basic;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DoubleCompare {
	public static void main(String[] args) {
		double d1 = 6.666;
		double d2 = 6.665;
		int i1 = Double.compare(d1, d2);
		outputResult(i1);

		Double dObj1 = new Double("6.666");
		Double dObj2 = new Double("6.665");
		int i2 = dObj1.compareTo(dObj2);
		outputResult(i2);
	}

	private static void outputResult(int i1) {
		if (i1 > 0) {
			System.out.println("参数1大");
		} else if (i1 < 0) {
			System.out.println("参数2大");
		} else {
			System.out.println("参数相等");
		}
	}
}
